USE WTPRAC;

INSERT INTO PERSON (first_name, last_name, phone_number, email, birth)								-- 1
     VALUES ('Eva', 'Green', '45544', 'alwaysnaked@gmail.com', '1980-06-06');							
INSERT INTO PERSON (first_name, last_name, phone_number, email, birth)								-- 2
     VALUES ('Audrey', 'Tautou', '182478144', 'ameli@gmail.com', '1976-08-09');						
INSERT INTO PERSON (first_name, last_name, phone_number, email, birth)								-- 3
     VALUES ('Colin', 'Farrell', '1824144', 'alexander@gmail.com', '1976-05-31');
INSERT INTO PERSON (first_name, last_name, phone_number, email, birth)								-- 4
     VALUES ('Christopher', 'Nolan', '18478144', 'CantWaitForInterstellar@gmail.com', '1970-06-30');
INSERT INTO PERSON (first_name, last_name, phone_number, email, birth)								-- 5
     VALUES ('Matthew', 'McConaughey', '184690', 'ezoscar@gmail.com', '1969-11-04');
INSERT INTO PERSON (first_name, last_name, phone_number, email, birth)								-- 6
     VALUES ('Leonardo', 'DiCaprio', '15578144', 'whereismyoscar@mail.ru', '1974-11-11');
INSERT INTO PERSON (first_name, last_name, phone_number, email, birth)								-- 7
     VALUES ('Michael', 'Fassbender', '1903144', 'shame@gmail.com', '1975-04-02');					
INSERT INTO PERSON (first_name, last_name, middle_name, email, birth)										-- 8
     VALUES ('ИВАН', 'Иван', 'иван', 'ivan@ivan.ivan', '1995-02-04');
     
INSERT INTO STOP (stop_name) VALUES ('MOSCOW'); 		
-- 1
INSERT INTO STOP (stop_name) VALUES ('LONDON');			
-- 2
INSERT INTO STOP (stop_name) VALUES ('JOHANNESBURG'); 	
-- 3
INSERT INTO STOP (stop_name) VALUES ('ANTANANARIVO'); 	
-- 4
INSERT INTO STOP (stop_name) VALUES ('WASHINGTON'); 	
-- 5
INSERT INTO STOP (stop_name) VALUES ('NEW-YORK'); 		
-- 6
INSERT INTO STOP (stop_name) VALUES ('PARIS'); 			
-- 7
INSERT INTO STOP (stop_name) VALUES ('SOCHI'); 			
-- 8
INSERT INTO STOP (stop_name) VALUES ('ROME'); 			
-- 9 
INSERT INTO STOP (stop_name) VALUES ('ST. PETERSBURG'); 
-- 10
INSERT INTO STOP (stop_name) VALUES ('BERLIN');			
-- 11
INSERT INTO STOP (stop_name) VALUES ('ISTANBUL');		
-- 12

INSERT INTO COMPANY (company_name) VALUES ('Test Airlines');				
-- 1
INSERT INTO COMPANY (company_name) VALUES ('Jetblue Airways');			
-- 2
INSERT INTO COMPANY (company_name) VALUES ('Aeroflot');					
-- 3
INSERT INTO COMPANY (company_name) VALUES ('American Airlines');		
-- 4
INSERT INTO COMPANY (company_name) VALUES ('South African Airways');	
-- 5
INSERT INTO COMPANY (company_name) VALUES ('Turkish Airlines');		
-- 6

INSERT INTO ROUTE (number, route_name, active) VALUES (1, "test1", true);
-- 1
INSERT INTO ROUTE (number, route_name, active) VALUES (20, "test2", true);
-- 2
INSERT INTO ROUTE (number, route_name, active) VALUES (33, "test3", true);
-- 3
INSERT INTO ROUTE (number, route_name, active) VALUES (42, "test4", true);
-- 4
INSERT INTO ROUTE (number, route_name, active) VALUES (55, "test5", false);
-- 5
INSERT INTO ROUTE (number, route_name, active) VALUES (55, "test5.1", true);
-- 6

INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (1, 1, 1);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (2, 1, 2);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (3, 1, 3);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (4, 1, 4);
-- 1
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (1, 2, 1);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (2, 2, 5);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (3, 2, 7);
-- 2
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (1, 3, 1);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (4, 3, 2);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (3, 3, 3);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (5, 3, 4);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (2, 3, 5);
-- 3
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (2, 4, 1);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (1, 4, 3);
-- 4;
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (1, 5, 10);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (3, 5, 8);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (4, 5, 7);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (2, 5, 5);
-- 5
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (1, 6, 10);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (3, 6, 8);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (4, 6, 11);
INSERT INTO ROUTE_STOPS (stop_number, route_id, stop_id) VALUES (2, 6, 12);
-- 6

INSERT INTO TRIP (number, route_id, company_id, seats) VALUES (1, 2, 1, 30);
-- 1
INSERT INTO TRIP (number, route_id, company_id, seats) VALUES (2, 2, 2, 20);
-- 2
INSERT INTO TRIP (number, route_id, company_id, seats) VALUES (3, 1, 3, 10);
-- 3
INSERT INTO TRIP (number, route_id, company_id, seats) VALUES (4, 3, 4, 15);
-- 4
INSERT INTO TRIP (number, route_id, company_id, seats) VALUES (5, 4, 5, 25);
-- 5
INSERT INTO TRIP (number, route_id, company_id, seats) VALUES (6, 5, 6, 35);
-- 6
INSERT INTO TRIP (number, route_id, company_id, seats) VALUES (3, 1, 3, 10);
-- 7
INSERT INTO TRIP (number, route_id, company_id, seats) VALUES (7, 6, 6, 5);
-- 8

INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (1, 1, 1000, '2016-06-04 10:00:00', '2016-06-04 11:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (1, 2, 1100, '2016-06-04 11:00:00', '2016-06-04 12:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (1, 3, 1010, '2016-06-04 12:00:00', '2016-06-04 13:00:00');
-- 1
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (2, 1, 2000, '2016-07-05 10:30:00', '2016-07-05 11:30:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (2, 2, 3000, '2016-07-05 12:00:00', '2016-07-05 13:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (2, 3, 4000, '2016-07-05 15:00:00', '2016-07-05 17:00:00');
-- 2
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (3, 1, 1000, '2017-06-05 05:00:00', '2017-06-05 11:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (3, 2, 3000, '2017-06-05 15:00:00', '2017-06-05 15:30:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (3, 3, 5000, '2017-06-05 16:30:00', '2017-06-05 17:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (3, 4, 7000, '2017-06-05 20:00:00', '2017-06-05 23:00:00');
-- 3
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (4, 1, 500, '2014-02-05 05:00:00', '2014-02-05 11:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (4, 2, 600, '2014-02-05 12:00:00', '2014-02-05 17:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (4, 3, 700, '2014-02-05 18:00:00', '2014-02-05 23:00:00');	
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (4, 4, 800, '2014-02-05 23:30:00', '2014-02-06 02:00:00');	
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (4, 5, 900, '2014-02-06 03:00:00', '2014-02-06 09:00:00');
-- 4
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (5, 1, 10000, '2013-01-10 05:00:00', '2013-01-10 11:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (5, 2, 20000, '2013-01-10 12:00:00', '2013-01-10 19:00:00');
-- 5
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (6, 1, 100, '2015-06-10 05:00:00', '2015-06-10 11:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (6, 2, 2620, '2015-06-10 12:00:00', '2015-06-10 12:10:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (6, 3, 1006, '2015-06-10 12:45:00', '2015-06-10 13:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (6, 4, 5060, '2015-06-10 14:00:00', '2015-06-10 15:00:00');
-- 6
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (7, 1, 10000, '2016-11-02 06:00:00', '2016-11-02 07:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (7, 2, 7000, '2016-11-02 09:00:00', '2016-11-02 11:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (7, 3, 6000, '2016-11-02 12:00:00', '2016-11-02 13:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (7, 4, 500, '2016-11-02 13:00:00', '2016-11-02 15:00:00');
-- 7
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (8, 1, 3000, '2014-11-02 05:00:00', '2014-11-02 11:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (8, 2, 5000, '2014-11-02 12:00:00', '2014-11-02 16:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (8, 3, 200, '2014-11-02 16:00:00', '2014-11-02 16:00:00');
INSERT INTO TIME_TABLE (trip_id, stop_number, price, arrival, departure) 
	VALUES (8, 4, 5000, '2014-11-02 16:00:00', '2014-11-02 17:00:00');
	
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (1, 1, 5, 7);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (2, 3, 2, 4);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (3, 5, 3, 1);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (4, 4, 3, 4);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (5, 7, 1, 3);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (6, 7, 2, 4);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (7, 2, 1, 7);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (8, 5, 3, 1);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (4, 6, 10, 8);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (6, 4, 5, 4);
INSERT INTO PERSON_TRIP (person_id, trip_id, departure_stop_id, arrival_stop_id) VALUES (7, 8, 12, 11);